<!-- 我的表单 -->

<template>
  <WebForm :one="info" class="ConfigCarbon-MyForm">
    <EasyRow v-if="CORE.MAP.ENERGY_HAS_ELEC">
      <FormInput label="电能" bind="electric" tip="请输入" prefix="1 kW·h = " suffix="kgce" number required />
    </EasyRow>

    <EasyRow v-if="CORE.MAP.ENERGY_HAS_WATER">
      <FormInput label="自来水" bind="water" tip="请输入" prefix="1 t = " suffix="kgce" number required />
    </EasyRow>

    <EasyRow v-if="CORE.MAP.ENERGY_HAS_GAS">
      <FormInput label="天然气" bind="gas" tip="请输入" prefix="1 m³ = " suffix="kgce" number required />
    </EasyRow>

    <BtnPrimary title="保存" @click="toClick" />
  </WebForm>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyForm',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixScreen()],

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 点击按钮
     */
    async toClick() {
      await this.refForm.check()
      this.startEdit()
    },
  },
}
</script>

<style lang="scss">
@import './index.scss';
</style>
